<template>
    <Menu :theme="theme3" active-name="1">
        <MenuGroup :title="leftMenuLists.name">
            <MenuItem :name="index" v-for="(item,index) in leftMenuLists.childLists" :key="index" :to="item.path" @click.native="change(item.webPath)">
                <Icon type="md-document" />
                {{item.name}}
            </MenuItem>
        </MenuGroup>
    </Menu>
</template>
<script>
import { Menu, MenuGroup, MenuItem, } from "view-design";
export default {
    inject: ['reload'],
    data() {
        return {
            theme1: "light",
            ios:'ios-analytics',
        };
    },
    props:["leftMenuLists"],
    components: { Menu, MenuGroup, MenuItem, },
    mounted() {},
    methods: {
        change(path) {
            if(path == '/index/doctorOperation/doctorregister/list?type=1' || path == '/index/doctorOperation/doctorregister/list?type=3' || path == '/index/doctorOperation/doctorregister/list?type=3') {
                this.reload()
            }
            if(path == '/index/familyDoctor/statisticaloverview'){
                window.open( window.location.protocol+"//"+window.location.host + '/operate/#/statisticaloverviewscreen');
            }
            // 公用方法
            this.functionJS.queryNavgationTo(this, path);
            // $router.onError(() => {
            //     const pattern = /Loading chunk (\d) + failed/g;
            //     const isChunkLoadFailed = error.message.match(pattern);
            //     if(isChunkLoadFailed) {
            //         location.reload()
            //     }
            // });
        }
    }
};
</script>
<style lang="less">
    .ivu-menu-light.ivu-menu-vertical .ivu-menu-item:not(.ivu-menu-MenuGroup){
        // background:#23646b;
        background:#f9f9f9;
    }
    .ivu-menu-light.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-MenuGroup) {
        // color: #fff;
        color: #333;
        background: #ebedf8;
        opacity: 0.8;
        border-right: 3px solid #9999CC;
        z-index: 2;
        box-shadow: 0 0 15px #9999FF;
    }
    .ivu-menu-MenuGroup-title{
        padding: 14px 24px;
        position: relative;
        cursor: pointer;
        z-index: 1;
        // color: #fff;
        color: #333;
        -webkit-transition: all .2s ease-in-out;
        transition: all .2s ease-in-out;
    }
    .ivu-menu-vertical .ivu-menu-item, .ivu-menu-vertical .ivu-menu-MenuGroup-title:hover {
        padding: 14px 24px;
        position: relative;
        cursor: pointer;
        z-index: 1;
        // color: #fff;
        color: #333;
        -webkit-transition: all .2s ease-in-out;
        transition: all .2s ease-in-out;
    }
    .ivu-menu-item .ivu-menu-item-active .ivu-menu-item-selected{
        border-right: none;
        // color: #fff;
        color: #333;
        background: #5362e1!important;
    }
    .ivu-menu-vertical .ivu-menu-item, .ivu-menu-vertical .ivu-menu-MenuGroup-title {
        padding: 14px 24px;
        position: relative;
        cursor: pointer;
        z-index: 1;
        // color: #fff;
        color: #333;
        -webkit-transition: all .2s ease-in-out;
        transition: all .2s ease-in-out;
    }
    .ivu-menu-vertical .ivu-menu-item:hover, .ivu-menu-vertical .ivu-menu-MenuGroup-title:hover, .ivu-menu-vertical .ivu-MenuItem:hover{
        background: #5362e1;
        color: #5362e1;
    }
</style>